MainView2 = BaseView:Extend()

function MainView2:New()
    local o = MainView2.super.New(self)
    o.abName = "ui_main"
    o.resName = "MainView2"
    o.layer = ENUM.UI_LAYER.MAIN
    o.hide_pre_view = true
    o.item_list = {}
    return o
end

function MainView2:loadSuccess()
    self.listView = GetNode(self.transform,{"Scroll"},"_ListView")
    self:InitEvent()

    self.listView:BindItemRender(function (index, widget)
        -- Debug.Log("index ===== {0}", index)
        self.item_list[widget.name] = self.item_list[widget.name] or MainViewItem:New(widget)
        self.item_list[widget.name]:SetData(self.testData[index + 1])
    end)

    --测试
    self.testData = {
        {
            name = "新缓存系统",
            view = "CacheView"
        },
        {
            name = "新资源加载",
            view = "ResLoadView"
        },
        {
            name = "计时器",
            view = "TimerView"
        },
        {
            name = "房间列表",
            view = "RoomListView"
        },
        {
            name = "Tween动画",
            view = "TweenView"
        },
        {
            name = "对象池",
            view = "PoolTestView"
        },
        {
            name = "寻路",
            view = "FindView"
        },
        {
            name = "事件系统",
            view = "EventView"
        },
        {
            name = "网络图片加载",
            view = "WebImgLoadView"
        }
    }
    
    self.listView.itemCount = #self.testData
end

function MainView2:InitEvent()
end

function MainView2:destroy_callback()
end

function MainView2:__delete()
end